<style>
	.header  { height: 120px; padding: 10px;}
	.header img { width: 90px;  padding: 0;}
	.header .plat_title { text-align: center; font-family: "微软雅黑"; color: orangered; line-height: 90px; 
		text-shadow: 2px 2px 5px grey; font-size: 42px; font-style: italic; font-weight: bolder; vertical-align: bottom;}
	.header .plat_title span { font-size: 14px; font-style: normal; margin-left: 10px; }

	.main { width: 100%; height: 400px; margin-top: 60px; display: flex; flex-flow: column nowrap; justify-content: center; align-items: center; }
	.main input { width: 60%; height: 32px; margin-top: 6px; }
	.main button { width: 120px; height: 32px; margin-top: 6px; }	
</style>
<section>
	<div class="header mui-bar mui-bar-nav">
		<img src="image/kklogo_600W.png">
		<div class="plat_title">快快统计平台<span>移动端</span></div>

	</div>

	<div class="mui-content">
		<div class="main">
			<input type="text" name="userName" placeholder="请输入用户名">
			<input type="password" name="password" placeholder="请输入密码">
			<button class="btn_login">登录</button>
		</div>
	</div>
</section>
<script>
	// 先清除原来的登录信息
	window.localStorage.removeItem('userlogin');
	$("button.btn_login").on('tap', function(){
		var condition = JSON.stringify({login_name: $("input[name=userName]").val(), password: hex_md5($("input[name=password]").val()), user_status: 1});
		$.post("http://101.200.201.27/adm/mkap/aj/pub/curd.php", {do: 'select', table: 'tj.operation_users', conditions: condition} , function(r){
			console.log(r)
			if(r.length > 0){
				
				userlogin = {userName: r[0].user_name, userID: r[0].user_id, user_type: r[0].user_type, right_id: r[0].right_id}
				var userloginStr = JSON.stringify(userlogin);
				window.localStorage['userlogin'] = userloginStr;
				rd.navito("pages", "homepage");
			}else{
				mui.toast('用户名或密码不正确');
			}
		}, 'json')
	})

	$("input[name=userName], input[name=password]").keyup(function(e){
		if(e.keyCode == 13){
			$("button.btn_login").click();
		}
	})	
</script>